package data;

import data.model.Task;

/**
 * Implement the task graph as an list of tasks (vertices) each of which will have adjacency sets
 *  of outgoing and incoming edges.
 * Include methods for access (dfs), addition, removal, and checking for cycles.
 * 
 * @author Will Home
 *
 */
public interface OldInterfaceTaskGraph {

	/**
	 * check whether a task is in the task graph and if so, return it
	 * 
	 * @param taskName
	 * @return specified task
	 */
	public Task getTask(String taskName);
	
	/**
	 * check whether a task is in the task graph and if so, return it
	 * 
	 * @param taskID
	 * @return specified task
	 */
	public Task getTask(int taskID);
	
	/**
	 * get the set of tasks that this is dependent upon
	 * 
	 * @param taskName
	 * @return set of indices of tasks upon which this depends
	 */
	public Object getDependent(String taskName);
	
	/**
	 * get the set of tasks that this is dependent upon
	 * 
	 * @param taskID
	 * @return set of indices of tasks upon which this depends
	 */
	public Object getDependent(int taskID);
	
	/**
	 * adds a new task to the graph
	 * 
	 * @param t new task
	 * @return success check
	 */
	public boolean addTask(Task t);
	
	/**
	 * Add a new dependency (directed edge) from the needed task to the dependent task
	 * 
	 * @param srcName task that is needed (source)
	 * @param destName dependent task (destination)
	 * @return success check
	 */
	public boolean addDep(String srcName, String destName);
	
	/**
	 * Add a new dependency (directed edge) from the needed task to the dependent task
	 * 
	 * @param srcID task that is needed (source)
	 * @param destID dependent task (destination)
	 * @return success check
	 */
	public boolean addDep(int srcID, int destID);
	
	/**
	 * Remove a task from the task graph, either adding its dependency set to tasks which are dependent on it,
	 *  or removing it completely
	 * 
	 * @param taskName task to be removed
	 * @param fuseDeps true if dependecies will be fused
	 * @return success check
	 */
	public boolean removeTask(String taskName, boolean fuseDeps);
	
	/**
	 * Remove a task from the task graph, either adding its dependency set to tasks which are dependent on it,
	 *  or removing it completely
	 * 
	 * @param taskID task to be removed
	 * @param fuseDeps true if dependecies will be fused
	 * @return success check
	 */
	public boolean removeTask(int taskID, boolean fuseDeps);
	
	/**
	 * Remove a dependency (directed edge)  from the needed task to the dependent task
	 * 
	 * @param srcName task that is needed (source)
	 * @param destName dependent task (destination)
	 * @return success check
	 */
	public boolean removeDep(String srcName, String destName);
	
	/**
	 * Remove a dependency (directed edge)  from the needed task to the dependent task
	 * 
	 * @param srcID task that is needed (source)
	 * @param destID dependent task (destination)
	 * @return success check
	 */
	public boolean removeDep(int srcID, int destID);
	
	/**
	 * Check that the task graph is acyclic
	 * 
	 * @return true if acyclic
	 */
	public boolean checkAcyclic();
	
	
	
}
